Remove case statement
Remove case statement

by using functions instead of case statement

- remove level of indentation
- allow use of local variables via "local" keyword

jobscale/apt-cyg,ilatypov/apt-cyg,balanx/apt-cyg,transcode-open/apt-cyg