Basic functionality improved and refactors