Fix app_cache_directory variable
Remove unused functions
Move constants together