Code cleanup and styles fix