add acra and code refactor