Refatored application

No changes to behaviour