Cleaned up few things, implemented reading local settings