Separated config parsing in separate class and improved lock file handling