Refactor code and remove extra resources