Cleanup code
Fix issue #https://trello.com/c/5tjMKylR
Fix issue #https://trello.com/c/Fv1WddTt