Started naive implementation of main handler